import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
import List from "../views/List.vue";
import Cart from "../views/Cart.vue";
import My from "../views/My.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/home",
    name: "Home",
    component: Home,
  },
  {
    path: "/list",
    name: "List",
    component: List,
  },
  {
    path: "/cart",
    name: "Cart",
    component: Cart,
  },
  {
    path: "/my",
    name: "My",
    component: My,
  },
  // {
  //   // path: "/search",
  //   // name: "Search",
  //   // component: Search,
  // },
  {
    path: "/",
    redirect: '/home'
  },
  {
    path: "/search",
    name: "Search",
    component: () =>    
      import("../views/Search.vue"),
  },
  {
    path: "/search-list",
    name: "Search-list",
    component: () =>    
      import("../views/Search-list.vue"),
  },
  {
    path: "/detail",
    name: "Detail",
    component: () =>    
      import("../views/Detail.vue"),
  },
  
];

const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});
234
export default router;
